
<script>
<?php echo "var data = $form";?>;
$(function(){
    $('#config_form').form('load',data);
    $('#tool_span').css('margin-right',$(window).width()-300);
    $('#config_save').on('click',function(){
        $('#config_form').form('submit',{
            url:'backend.php?r=setting/save',
            success:function(meg) {
                var data = eval('('+meg+')');
                if (data.success)
                {
                    $.messager.alert('提示','修改成功');
                }
                else
                {
                    $.messager.alert('提示','修改失败');
                }
            }

        })
    });
    $('#config_reload').on('click',function(){
        $('#config_form').form('load')
    });

})

function configSbmit() {
    if($('#config_form').form('validate')){

    }
}
</script>
<style>
    input
    {
        width:180px;
    }
</style>
<div class='easyui-panel' title='系统设置' data-options="fit:true,border:false">
<form class='easyui-form' id ='config_form'  method='POST'>
     <div id="tt" class="easyui-tabs"  data-options="tools:'#tab-tools',border:false" >
		<div title="基本配置"  style="padding:20px;">
            <div style='margin:10px 10px 0px 25px;'>
                <label for="title">标题:</label>
			    <input class='easyui-validatebox' data-options='required:true' missingMessage='标题不能为空' type='text' name='title'  validType="length[0,32]"  invalidMessage="标题长度在0-32位之间" >
           </div>

            <div style='margin:10px 10px 0px 25px;'>
                <label for="address">网址:</label>
            <input class='easyui-validatebox' type='text' name='address' validType='url' invalidMessage='请输入URL地址'>
            </div>
            <div style='margin:10px 10px 0px 12px;'>
                <label for="keywords">关键字:</label>
                <input class='easyui-validatebox' type='text' name='keywords'  validType='length[0,32]' invalidMessage='关键字在0-32位之间'>
            </div>
		</div>

        <div title="核心配置"  style="padding:20px;">
            <div style='margin:10px 10px 0px 15px;'>
                <label for="backups">备份周期:</label>
                <input class='easyui-numberbox' id='backups' type='text'  name='backups'>
            </div>
            <div style='margin:10px 10px 0px 25px;'>
                <label for="port">端口号:
	            <input class='easyui-numberbox'   id='port' type='text' name='port'>
            </div>
		</div>
	</div>

    <div id="tab-tools" >
    <span id ='tool_span'>
		<a href="#" class="easyui-linkbutton"  data-options="plain:true,iconCls:'icon-save'"   id='config_save'>保存</a>|
        <a href="#" class="easyui-linkbutton"  data-options="plain:true,iconCls:'icon-reload'" id='config_reload'>刷新</a>
    </span>
	</div>
</form>
</div>